#ifndef ENVIRONMENT_HPP
#define ENVIRONMENT_HPP

class Environment
{
public:
	/// Construct an environment from 'environ', which is received from the
	/// parent process.
	Environment();
	Environment(const Environment &copy);
	~Environment();
	
	char **c_strs();
	const char *const *c_strs() const;
	
	void set(string name, string value);
	string get(string name) const;
	
protected:
	int numVars;
	int varsAlloc;
	char **vars;
	map<string, int> index;
};

string extractKey(const char *str);
string extractValue(const char *str);

#endif
